package com.wicket.okrobff.web.contorller;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrobff.biz.service.SecurityService;
import com.wicket.okrobff.biz.service.dto.req.*;
import com.wicket.okrobff.biz.service.dto.res.*;
import com.wicket.okrobff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okroperation.integration.FwOperationSecurityClient;
import com.wicket.okrframework.integration.dto.ArchiveSoftwareAuthorizationRespDto;
import com.wicket.okrframework.integration.dto.ArchiveSoftwareAuthorizationReqDto;
import com.wicket.okrobff.common.exception.Assert;
import com.wicket.okrframework.integration.dto.QuerySoftwareAuthorizationDetailRespDto;
import com.wicket.okrframework.integration.dto.QuerySoftwareAuthorizationDetailReqDto;
import com.wicket.okrframework.integration.FwBaseInductionRecordClient;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryInductionRecordInfoDetailComReqDto;
import com.wicket.okrobff.common.util.CommonFunctionHelper;
import com.wicket.okrframework.integration.dto.UpdateSoftwareAuthorizationRespDto;
import com.wicket.okrframework.integration.dto.UpdateSoftwareAuthorizationReqDto;
import com.wicket.okrframework.integration.dto.DeleteSoftwareAuthorizationRespDto;
import com.wicket.okrframework.integration.dto.DeleteSoftwareAuthorizationReqDto;
import com.wicket.okroperation.integration.dto.ImplementBrushSoftwareAuthorizationRespDto;
import com.wicket.okroperation.integration.dto.ImplementBrushSoftwareAuthorizationReqDto;
import com.wicket.okrframework.integration.dto.AddGenerateLicenseComRespDto;
import com.wicket.okrframework.integration.dto.AddGenerateLicenseComReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "Security", tags = { "Security" })
@RestController
// @RequestMapping("/operationbff/security/")
public class SecurityController {

  @Autowired
  SecurityService securityService;
/**
   * B6存档软件授权证书(管理)
   * gen by moon at 5/18/2023, 4:34:20 PM
   */
    @PostMapping("/oms/platform/operation/mgt/security/archiveSoftwareAuthorization")
    @ApiOperation(value = "B6存档软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffArchiveSoftwareAuthorizationRespDto> archiveSoftwareAuthorization(@RequestBody(required=false) @Validated BffArchiveSoftwareAuthorizationReqDto reqDTO){
        return OkrResult.success(securityService.archiveSoftwareAuthorization(reqDTO));
    }
/**
   * B6查询软件授权证书详情(管理)
   * gen by moon at 5/18/2023, 4:45:18 PM
   */
    @PostMapping("/oms/platform/operation/mgt/security/querySoftwareAuthorizationDetail")
    @ApiOperation(value = "B6查询软件授权证书详情(管理)", response = OkrResult.class)
    public OkrResult<BffQuerySoftwareAuthorizationDetailRespDto> querySoftwareAuthorizationDetail(@RequestBody(required=false) @Validated BffQuerySoftwareAuthorizationDetailReqDto reqDTO){
        return OkrResult.success(securityService.querySoftwareAuthorizationDetail(reqDTO));
    }
/**
   * B6修改软件授权证书(管理)
   * gen by moon at 5/18/2023, 4:45:20 PM
   */
    @PostMapping("/oms/platform/operation/mgt/security/updateSoftwareAuthorization")
    @ApiOperation(value = "B6修改软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffUpdateSoftwareAuthorizationRespDto> updateSoftwareAuthorization(@RequestBody(required=false) @Validated BffUpdateSoftwareAuthorizationReqDto reqDTO){
        return OkrResult.success(securityService.updateSoftwareAuthorization(reqDTO));
    }
/**
   * B6删除软件授权证书(管理)
   * gen by moon at 5/18/2023, 4:45:22 PM
   */
    @PostMapping("/oms/platform/operation/mgt/security/deleteSoftwareAuthorization")
    @ApiOperation(value = "B6删除软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffDeleteSoftwareAuthorizationRespDto> deleteSoftwareAuthorization(@RequestBody(required=false) @Validated BffDeleteSoftwareAuthorizationReqDto reqDTO){
        return OkrResult.success(securityService.deleteSoftwareAuthorization(reqDTO));
    }
/**
   * B6执行刷软件授权证书(管理)
   * gen by moon at 5/21/2023, 7:13:52 AM
   */
    @PostMapping("/oms/platform/operation/mgt/security/implementBrushSoftwareAuthorization")
    @ApiOperation(value = "B6执行刷软件授权证书(管理)", response = OkrResult.class)
    public OkrResult<BffImplementBrushSoftwareAuthorizationRespDto> implementBrushSoftwareAuthorization(@RequestBody(required=false) @Validated BffImplementBrushSoftwareAuthorizationReqDto reqDTO){
        return OkrResult.success(securityService.implementBrushSoftwareAuthorization(reqDTO));
    }
/**
   * B6生成License(管理)
   * gen by moon at 5/25/2023, 11:23:12 PM
   */
    @PostMapping("/oms/platform/operation/mgt/security/generateGenerateLicense")
    @ApiOperation(value = "B6生成License(管理)", response = OkrResult.class)
    public OkrResult<BffGenerateGenerateLicenseRespDto> generateGenerateLicense(@RequestBody(required=false) @Validated BffGenerateGenerateLicenseReqDto reqDTO){
        return OkrResult.success(securityService.generateGenerateLicense(reqDTO));
    }
}
